1. Technical Field
This invention generally relates to computer systems, and more specifically relates to apparatus and methods for processing computer programs.
2. Background Art
Since the dawn of the computer age, computer systems have evolved into extremely sophisticated devices, and computer systems may be found in many different settings. Computer systems typically include a combination of hardware (e.g., semiconductors, circuit boards, etc.) and software (e.g., computer programs). As advances in semiconductor processing and computer architecture push the performance of the computer hardware higher, more sophisticated computer software has evolved to take advantage of the higher performance of the hardware, resulting in computer systems today that are much more powerful than just a few years ago.
Computer systems typically include operating system software that controls the basic function of the computer, and one or more software application programs that run under the control of the operating system to perform desired tasks. For example, a typical IBM Personal Computer may run the Microsoft Windows operating system, and under the control of the Windows operating system, a user may execute an application program, such as a word processor. As the capabilities of computer systems have increased, the application software programs designed for high performance computer systems have become extremely powerful. However, software development costs have continued to rise because more powerful and complex programs take more time, and hence more money, to produce.
One way in which the performance of application software programs has been improved while the associated development costs have been reduced is by using object-oriented programming concepts. The goal of using object-oriented programming is to create small, reusable sections of program code known as “objects” that can be quickly and easily combined and re-used to create new programs. This is similar to the idea of using the same set of building blocks again and again to create many different structures. The modular and re-usable aspects of objects will typically speed development of new programs, thereby reducing the costs associated with the development cycle. In addition, by creating and re-using a comprehensive set of well-tested objects, a more stable, uniform, and consistent approach to developing new computer programs can be achieved.
A central concept in object-oriented programming is the “class.” A class is a template that defines a type of object. A class outlines or describes the characteristics or makeup of objects that belong to that class. By defining a class, objects can be created that belong to the class without having to rewrite the entire definition for each new object as it is created. This feature of object-oriented programming promotes the reusability of existing object definitions and promotes more efficient use of program code.
The Java programming language developed by Sun Microsystems is one modern object oriented programming language that has become very popular in recent years. Java offers many features and advantages that makes it a desirable programming language to use. First, Java is specifically designed to create small application programs, commonly called “applets,” that can reside on the network in centralized servers, and which are delivered to the client machine only when needed. Second, Java is completely platform independent. A Java program can be written once and can then run on any type of platform that contains a Java Virtual Machine (JVM). The JVM model is supported by most computer vendors, thereby allowing a software vendor to have access to hardware and software systems produced by many different companies. Finally, Java is an object oriented language, meaning that software written in Java can take advantage of the benefits of object oriented programming techniques.
For Java to be platform-independent, a JVM typically converts the Java platform-independent bytecodes to corresponding platform-specific operations. This dynamic conversion of Java code creates undesirable overhead in the execution of a Java program. In many cases, this overhead is justified by the platform-independence that is achieved by programming in Java. In some cases, the overhead of performing real-time conversion of Java bytecodes may be reduced by processing the bytecodes of a Java class to generate platform-specific code, then saving the platform-specific code. The next time the same class is invoked, the platform-specific code can be retrieved instead of requiring real-time interpretation of the platform-independent Java bytecodes.
One specific way to improve the performance of a Java program is shown in U.S. Ser. No. 09/024,111 by Hicks filed on Feb. 17, 1998. This pending patent application discloses a way to process a class file to generate platform-dependent code, then save the platform-dependent code as an attribute of the original class file. In this manner, the class file may still be used by other platforms, but the platform-dependent code may be invoked by any computer system that is of the same platform type. By invoking platform-dependent code that has been pre-processed, the overhead of processing the platform-independent bytecodes is reduced, thereby enhancing the performance of the Java program.
The method disclosed in the '111 patent application allows attaching previously-processed information, referred to generically herein as analyzed program information, to a class file. Note, however, that in some cases, the class file is either unknown or is unavailable. For example, if bytecodes for a Java class are sent via a network connection, the parent class file may be unavailable. Likewise, in an IBM iSeries computer, a class may be created by passing bytecodes that define a Java class to a user-defined class loader, which then uses the defineClass interface to create the class represented by the bytecodes. In this case, the parent class of the bytecodes is unknown. Another way for a class file to be unknown is for a class to be generated dynamically. In all of these cases, there is no known class file to which the analyzed program information can be attached. For this reason, when no class file can be identified, the class information must be processed each time it is used. Without a way to save analyzed program information when no corresponding class file can be identified, JVMs will continue to suffer undue performance penalties by needlessly processing Java classes that have previously been processed.